package com.lzh.oss.demo.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @ClassName ExcelListener
 * Description
 * @Author lizihao
 * Date 2020/11/30 11:44
 * @Version 1.0
 **/
public class ExcelListener extends AnalysisEventListener<StockData> {
    List<StockData> list = new ArrayList<StockData>();

    @Override
    public void invoke(StockData stockData, AnalysisContext analysisContext) {
        System.out.println("```"+stockData);
        list.add(stockData);
    }

    //读取excel表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息："+headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
